﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PortalParts/PageMorePartyRepresentative.Master" AutoEventWireup="true" CodeBehind="Suggestions.aspx.cs" Inherits="ZHDJ.Web.Portal.PartyRepresentative.Suggestions" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../../Resource/js/Nailthumb/jquery.nailthumb.1.1.min.css" rel="stylesheet" />

    <script src="../../Resource/js/Nailthumb/jquery.nailthumb.1.1.min.js"></script>
    <script src="../../Resource/js/default/jquery.tmpl.min.js"></script>
    <script src="../../Resource/js/knockout/knockout-3.4.0.js"></script>
    <script src="../../Resource/js/jquery/jquery.pagination.js"></script>
    <script>
        var pageSize = 5, isBind = false;
        var initImgSize = function () {
            $('.nailthumb-container').each(function (i, n) {
                $(n).nailthumb({ width: 122, height: 140, method: 'resize', fitDirection: 'center center' });
            });

        }
        var paginationPara = {
            num_edge_entries: 1, //边缘页数
            num_display_entries: 4, //主体页数
            callback: pageselectCallback,
            items_per_page: pageSize, //每页显示1项
            prev_text: "上一页",
            next_text: "下一页",
            link_to: "javascript:void(0);"
        }
        var ViewModel = {
            qdate: ko.observableArray(),
            loadContacts: function (pageIndex) {
                $.get("Suggestions.aspx", {
                    PageIndex: pageIndex,
                    PageSize: pageSize,
                    StudioID: $("#ctl00_ContentPlaceHolder1_hdStudioID").val(),
                    QueryStatus: $("#QueryStatus").val(),
                    QueryText: $("#QueryText").val(),
                    r: (new Date()).getTime()
                },
                    function (data) {
                        var ss = eval("(" + data + ")");

                        ViewModel.qdate(eval("(" + data + ")"));
                    });
            }
        }

        function initPage() {
            $.get("Suggestions.aspx", {
                DataCount: 1, QueryStatus: $("#QueryStatus").val(),
                QueryText: $("#QueryText").val(),
                StudioID: $("#ctl00_ContentPlaceHolder1_hdStudioID").val(), r: (new Date()).getTime()
            },
                function (data) {
                    var totalCount = parseInt(data);
                    if (totalCount == 0) {
                        $("#trnonedata").show();
                    }
                    $("#pagination").pagination(totalCount, paginationPara);
                });
        }
        function pageselectCallback(pageIndex, jq) {
            ViewModel.loadContacts(pageIndex);
            if (!isBind) {
                ko.applyBindings(ViewModel);
                isBind = true;
            }

        }
        $(function () {
            //initImgSize();
            initPage();
            $("#btnQuery").click(function () {
                initPage();
            });
        });
        function su() {
            window.location.href = window.location.href;
        }


    </script>
    <script id="myTemplate" type="text/x-jquery-tmpl">
        <tr class="tr_a">
            <td class="td1"><a href="SuggestionDetail.aspx?id=${ID}" target="_blank">${Title}</a></td>
            <td class="td2">${StatusName}</td>
            <td class="td2">${CreateTime2}</td>
            <td class="td2">${ModifyTime2}</td>
        </tr>
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="morequerybar">
        <table>
            <tr>
                <td><span>主题：</span></td>
                <td>
                    <input class="text1" id="QueryText" type="text" style="width: 200px; margin-right: 20px;" />
                </td>
                <td><span>状态：</span></td>
                <td>
                    <select class="ddl1" id="QueryStatus" style="width: 200px; height: 38px; line-height: 38px;">
                        <option value="">请选择</option>
                        <option value="1">待处理</option>
                        <option value="2">已处理</option>
                    </select>

                </td>
                <td>
                    <button type="button" class="mybtn" id="btnQuery" style="width: 60px; margin-left: 20px; height: 38px; line-height: 38px;">搜索</button>
                </td>
            </tr>
        </table>
    </div>
    <div class="cztable" style="margin-top: 20px;">
        <table class="table_a table_b" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td class="tdbar_a" style="width: auto;">主题</td>
                <td class="tdbar_a" style="width: 200px;">状态</td>
                <td class="tdbar_a" style="width: 200px;">留言时间</td>
                <td class="tdbar_a" style="width: 200px;">回复时间</td>
            </tr>

            <!-- ko template: { name: 'myTemplate', foreach: qdate} -->
            <!-- /ko -->
            <tr style="display: none" id="trnonedata" class="tr_a">
                <td class="td2" style="text-align: center" colspan="4">无数据……</td>
            </tr>
        </table>
        <div class="pagination">
            <div id="pagination">
            </div>
        </div>
    </div>
    <f:PageManager ID="PageManager1" runat="server" />
    <asp:HiddenField ID="hdStudioID" runat="server" />
    <f:Form runat="server" ShowBorder="false" ShowHeader="false" ID="Form21">

        <Items>
            <f:ContentPanel runat="server" ID="sdfsdf" ShowBorder="false">

                <div class="cztable mycontactinfo" style="margin-top: 20px; background: #f7f7f7;">
                    <table class="table_b" border="0" cellspacing="0" cellpadding="0">
                        <tr class="tr_b ">
                            <td class="tdbar" colspan="4">
                                <h5>心声传递</h5>
                            </td>
                        </tr>
                        <tr class="tr_b">
                            <th class="th_b">姓名：</th>
                            <td class="td_b" style="text-align: left;">
                                <f:TextBox ID="txtUserName" Width="200px" Readonly="true" runat="server" Required="true" ShowRedStar="true"></f:TextBox>
                            </td>
                            <th class="th_b">联系方式：</th>
                            <td class="td_b" style="text-align: left;">
                                <f:TextBox ID="txtMobileNo" Width="200px" runat="server" Required="true" ShowRedStar="true"></f:TextBox>
                            </td>
                        </tr>
                        <tr class="tr_b">
                            <th class="th_b">年龄：</th>
                            <td class="td_b" style="text-align: left;">
                                <f:NumberBox ID="txtAge" Width="200px" MinValue="0" runat="server" Required="true" ShowRedStar="true"></f:NumberBox>
                            </td>
                            <th class="th_b">性别：</th>
                            <td class="td_b" style="text-align: left;">
                                <f:DropDownList ID="ddlSex" Width="200px" runat="server" Required="true" ShowRedStar="true">
                                    <f:ListItem Text="请选择" Value="" />
                                    <f:ListItem Text="男" Value="0" />
                                    <f:ListItem Text="女" Value="1" />
                                </f:DropDownList>
                            </td>
                        </tr>
                        <tr class="tr_b">
                            <th class="th_b">职务：</th>
                            <td class="td_b" style="text-align: left;">
                                <f:TextBox ID="txtPost" Width="200px" runat="server" Required="true" ShowRedStar="true">
                                </f:TextBox>
                            </td>
                            <th class="th_b">政治面貌：</th>
                            <td class="td_b" style="text-align: left;">
                                <f:TextBox ID="txtPoliticsLineament" Width="200px" runat="server" Required="true" ShowRedStar="true">
                                </f:TextBox>
                            </td>

                        </tr>
                        <tr class="tr_b">
                            <th class="th_b">工作单位：</th>
                            <td class="td_b" colspan="3" style="text-align: left;">
                                <f:TextBox ID="txtWorkUnit" Width="557px" runat="server" Required="true" ShowRedStar="true">
                                </f:TextBox>
                            </td>
                        </tr>
                        <tr class="tr_b">
                            <th class="th_b">联系地址：</th>
                            <td class="td_b" colspan="3" style="text-align: left;">
                                <f:TextBox ID="txtAddress" Width="557px" runat="server" Required="true" ShowRedStar="true">
                                </f:TextBox>
                            </td>
                        </tr>
                        <tr class="tr_b">
                            <th class="th_b">邮政编号：</th>
                            <td class="td_b" style="text-align: left;">
                                <f:TextBox ID="txtZip" Width="200px" runat="server" Required="true" ShowRedStar="true">
                                </f:TextBox>
                            </td>

                            <th class="th_b">党代表：</th>
                            <td class="td_b" style="text-align: left;">
                                <f:DropDownList ID="ddlRepresentativeID" Width="200px" runat="server" Required="true" ShowRedStar="true">
                                </f:DropDownList>
                            </td>
                        </tr>
                        <tr class="tr_b">
                            <th class="th_b">主题：</th>
                            <td class="td_b" colspan="3" style="text-align: left;">
                                <f:TextBox ID="txtTitle" Width="557px" runat="server" Required="true" ShowRedStar="true">
                                </f:TextBox>

                            </td>
                        </tr>
                        <tr class="tr_b">
                            <th class="th_b">意见分类：</th>
                            <td class="td_b" style="text-align: left;">
                                <f:DropDownList ID="ddlSuggestionCategory" Width="200px" runat="server" Required="true" ShowRedStar="true">
                                </f:DropDownList>
                            </td>

                            <th class="th_b">是否公开：</th>
                            <td class="td_b" style="text-align: left;">
                                <f:DropDownList ID="ddlIsOpen" Width="200px" runat="server" Required="true" ShowRedStar="true">
                                    <f:ListItem Text="是" Value="1" Selected="true" />
                                    <f:ListItem Text="否" Value="0" />
                                </f:DropDownList>
                            </td>
                        </tr>
                        <tr class="tr_b">
                            <th class="th_b">反映内容：</th>
                            <td class="td_b" colspan="3" style="text-align: left;">
                                <f:TextArea ID="txtContent" Width="557px" runat="server" Required="true" ShowRedStar="true"></f:TextArea>
                            </td>

                        </tr>
                        <tr class="tr_b mysubtn">
                            <td class="td_b" colspan="4" style="text-align: center">
                                <f:Button ID="btnSave" ValidateForms="sdfsdf" CssClass="mybtn" OnClick="btnSave_Click" runat="server" Text="提交"></f:Button>
                            </td>

                        </tr>
                    </table>
                </div>
            </f:ContentPanel>
        </Items>
    </f:Form>
</asp:Content>
